package cn.jiuxiaoer.job.jobhandler;

import cn.jiuxiaoer.job.service.ShopDetailService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


/**
 * 过期商品预警任务
 * @author gzk
 * @date 2021/00/26 12:00
 */
@Slf4j
@Component
public class WarningJob {

    @Autowired
    private ShopDetailService shopDetailService;

    /**
     * 过期商品预警定时器
     */
    @XxlJob("OverDueHandler")
    public ReturnT<String> OverDueHandler() throws Exception {
        Boolean flag = shopDetailService.getList();
        if(flag) {
            return ReturnT.SUCCESS;
        }else{
            return ReturnT.FAIL;
        }
    }
}
